package 反射;

import java.lang.reflect.Method;

public class test2 {
    public static void main(String[] args) throws NoSuchMethodException {
        Student student = new Student();
//        System.out.println(student.getClass());
//        System.out.println(student.getClass().getSuperclass());

//        Method[] methods = student.getClass().getDeclaredMethods();
//        for (Method method : methods) {
//            System.out.println(method);
//        }
        System.out.println(student.getClass().getMethod("say", null));
//        System.out.println(student.getClass().getMethod(s));
    }
}


class Persion{

    void say(){

    }
}

class Student extends Persion{

    public static int age =10;

    public String name;
    public Student(String name) {
        this.name = name;
    }

    public Student() {

    }


    public void say() {
        System.out.println("stuent");
    }
}